import { FORMTYPEDATA } from "../../../type";

export interface DateComponentProps {
  modelValue?: number | string | Date | [Date, Date] | null;
  placeholder?: string;
  type?: string;
  format?: string;
  valueFormat?: string;
  startPlaceholder?: string;
  endPlaceholder?: string;
  rangeSeparator?: string;
  unlinkPanels?: boolean;
}
export interface DateComponentData {
  options: {
    label: string;
    value: string;
  }[];
}
export const DateItemAttr: FORMTYPEDATA<DateComponentProps, DateComponentData> =
  {
    componentStyle: {
      width: 200,
    },
    // 传给给组件的属性，默认会吧所有的props都传递给控件
    componentProps: {
      type: "date",
      modelValue: null,
      placeholder: "请输入内容",
    },
    // 数据来源
    componentData: {
      options: [],
    },
    // 是否隐藏
    hidden: false,
    // 组件显隐规则
    hiddenRules: [],
    elFormItemProps: {
      // 是否必选
      required: false,
      error: "",
      showMessage: true,
      inlineMessage: "",
      labelPosition: "",
      rules: [],
    },
  };
